package com.ruoyi.project.system.baseinfo.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.project.system.baseinfo.domain.PieData;
import com.ruoyi.project.system.baseinfo.mapper.TNewbornBaseinfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/system/report")
public class TDataReport extends BaseController {
    @Autowired
    private TNewbornBaseinfoMapper tNewbornBaseinfoMapper;

    private String prefix = "system/report";


    /**
     * 获取数据报表
     */
    @GetMapping()
    public String detail(ModelMap mmap)
    {
        // 构建饼图数据
        List<PieData> pieDataList = tNewbornBaseinfoMapper.selectPieData();
        mmap.put("pieDataList",pieDataList);
        return prefix + "/detail";
    }
}
